home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / pyshared / AptUrl / UI.py < prev    next >
Text File  |  2009-09-18  |  2KB  |  47 lines

  1.  
  2. import Helpers
  3. from Helpers import utf8, _, _n
  4.  
  5. class AbstractUI(object):
  6.     # generic dialogs
  7.     def error(self, summary, msg):
  8.         return False
  9.     def yesNoQuestion(self, summary, msg, title, default='no'):
  10.         pass
  11.     def message(self, summary, msg):
  12.         return True
  13.     
  14.     # specific dialogs
  15.     def askEnableSections(self, sections):
  16.         " generic implementation, can be overridden "
  17.         return self.yesNoQuestion(_("Enable additional components"),
  18.                                   _n("Do you want to enable the following "
  19.                                          "component: '%s'?",
  20.                                          "Do you want to enable the following "
  21.                                          "components: '%s'?",
  22.                                          len(sections)) % ", ".join(sections))
  23.     def askEnableChannel(self, channel, channel_info_html):
  24.         " generic implementation, can be overridden "
  25.         return self.yesNoQuestion(_("Enable additional software channel"),
  26.                                   _("Do you want to enable the following "
  27.                                     "software channel: '%s'?") % channel)
  28.     def askInstallPackage(self):
  29.         pass
  30.  
  31.     # install/update progress 
  32.     def doUpdate(self):
  33.         pass
  34.     def doInstall(self, pkglist):
  35.         pass
  36.  
  37.     # UI specific actions for enabling stuff
  38.  
  39.     # FIXME: the next two functions shoud go into generic code
  40.     #        that checks for the availablility of tools
  41.     #        like gksu or kdesudo and uses them 
  42.     #        appropriately
  43.     def doEnableSection(self, sections):
  44.         pass
  45.     def doEnableChannel(self, channelpath, channelkey):
  46.         pass
  47.